package cn.com.bluemoon.daps.model.vo.group.in;

import cn.com.bluemoon.daps.common.domain.UserPermissionApi;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 加入组vo
 *
 * @author Jarod.Kong
 * @date 2021/2/2 13:51
 */
@ApiModel(description = "加入组vo")
@Data
@Accessors
@EqualsAndHashCode
public class TableAddGroupVo implements Serializable, UserPermissionApi<String> {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "所选表ids")
    @NotEmpty(message = "请选择相关表")
    private List<String> tableIds = new ArrayList<>();

    @ApiModelProperty(value = "表所在的组id")
    private String groupId;

    @ApiModelProperty(value = "模型id")
    @NotEmpty(message = "模型id不可为空")
    private String modelId;

    /**
     * @return 获取mvc传输中对应模型的id
     */
    @Override
    public String getUserPermissionKeyValue() {
        return getModelId();
    }
}
